package bean

import (
	"net/http"
)

type ResponseParam struct {
	Status  int    `json:"status"`
	Success bool   `json:"success"`
	Message string `json:"message"`
	Data    any    `json:"data"`
	ExtData any    `json:"extdata"`
}

func (param *ResponseParam) Succeed(message string) *ResponseParam {
	param.Success = true
	param.Message = message
	param.Status = http.StatusOK
	return param
}

func (param *ResponseParam) Failure(message string) {
	param.Success = false
	param.Message = message
	param.Status = http.StatusBadRequest
}
